import { FC, memo, useEffect, useRef } from 'react'

const BlogContent: FC<{ content: string }> = ({ content }) => {
  const divHTML = useRef<HTMLDivElement | null>(null)
  console.log('render')
  useEffect(() => {
    divHTML.current!.innerHTML = content
  }, [content])
  return <div ref={divHTML}>{content}</div>
}
// memo 第二个餐素 如果为返回true，则不渲染，如果返回false，则渲染
export default memo(BlogContent, (pre, cur) => {
  return pre.content === cur.content
})
